package br.com.tecvel.control.conexao;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;

/**
 *
 * @author RAFAEL
 */
public class Conexao {
    private EntityManagerFactory factory;
    private EntityManager eM;
    private EntityTransaction eT;
    
    public Conexao() {
        factory = Persistence.createEntityManagerFactory("Tecvel");
        
    }
    public void conectar(){
        eM = factory.createEntityManager();
        eT = eM.getTransaction();
    }
    public EntityManager getEntityManager(){
        return eM;
    }
    public EntityTransaction getEntityTransaction(){
        return eT;
    }
    
    
}
